package business;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import pojo.Test;

public class TestMain {

	
	public static void main (String[] args){
		 EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory( "entityManager" );
		 
		 EntityManager entityManager = entityManagerFactory.createEntityManager();
		 entityManager.getTransaction().begin();
//		 entityManager.persist( new Event( "Our very first event!", new Date() ) );
//		 entityManager.persist( new Event( "A follow up event", new Date() ) );
		 Test test = new Test();
		 test.setNom("marouane ");
		 test.setPrenom("bilal");
		 entityManager.persist(test);
		 entityManager.getTransaction().commit();
		 entityManager.close();
	}
}
